package com.dragon.user_service.Exception;

/*
* 封装自己的业务异常,返回给前端,让前端能够看懂是报了个什么错
* */
public class BusinessException extends RuntimeException{
    private final Integer code;


    public BusinessException(StateCode code, String Message) {
        super(Message);
        this.code = code.getCode();
    }

    public BusinessException(StateCode code) {
        super(code.getMessage());
        this.code = code.getCode();

    }
    public Integer getCode(){
        return code;
    }

}
